<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>LabeledBubbleSeries.as</title>
<link rel="stylesheet" type="text/css" href="../../../../../../SourceStyles.css"/>
</head>

<body><pre><span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">robsondesign</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">series</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">robsondesign</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">renderers</span>.<span class="ActionScriptDefault_Text">LabeledBubbleRenderer</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">charts</span>.<span class="ActionScriptDefault_Text">series</span>.<span class="ActionScriptDefault_Text">BubbleSeries</span>;
    <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">core</span>.<span class="ActionScriptDefault_Text">ClassFactory</span>;
    
    <span class="ActionScriptASDoc">/**
     * Determines the horizontal alignment of the text in the bubble label.
     * @default center
     */</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;textAlign&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">enumeration</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;left,center,right&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;yes&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    <span class="ActionScriptASDoc">/**
     * Determines the vertical alignment of the text in the bubble label.
     * @default top
     */</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;textVAlign&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">enumeration</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;top,middle,bottom&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;yes&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    
    <span class="ActionScriptASDoc">/**
     * Extends BubbleSeries to display bubbles with labels
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">LabeledBubbleSeries</span> <span class="ActionScriptReserved">extends</span> <span class="ActionScriptDefault_Text">BubbleSeries</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptASDoc">/**
         * Name of data field to be displayed in bubble label
         */</span>
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">labelField</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&quot;</span>;
        
        <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> 
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptOperator">==</span><span class="ActionScriptString">&quot;textAlign&quot;</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptOperator">==</span><span class="ActionScriptString">&quot;textVAlign&quot;</span><span class="ActionScriptBracket/Brace">)</span> 
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">invalidateDisplayList</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptASDoc">/**
         * Constructor
         */</span>
        <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">LabeledBubbleSeries</span><span class="ActionScriptBracket/Brace">()</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span><span class="ActionScriptBracket/Brace">()</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;itemRenderer&quot;</span>, <span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">ClassFactory</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">LabeledBubbleRenderer</span><span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;textAlign&quot;</span>, <span class="ActionScriptString">&quot;center&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;textVAlign&quot;</span>, <span class="ActionScriptString">&quot;top&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>
<span class="ActionScriptBracket/Brace">}</span></pre></body>
</html>
